var QIU_PICK_CONTROL = {
	"bjpk10": pk10Fn,
	"2fpk10": pk10Fn,
	"xyft": pk10Fn,
	"xysm": pk10Fn,
	"2fft": pk10Fn,
	"cqssc": sscFn,
	"2fssc": sscFn,
	"tjssc": sscFn,
	"xjssc": sscFn,
	"gdkl10f": kl10fFn,
	"cqkl10f": kl10fFn,
	"ah11x5": cz11x5Fn,
	"gd11x5": cz11x5Fn,
	"jx11x5": cz11x5Fn,
	"sd11x5": cz11x5Fn,
	"sh11x5": cz11x5Fn,
	"xg6hc": xg6hcFn,
	"5f6hc":xg6hcFn,
	"shssl": sslFn,
	"pl3": sslFn,
	"fc3d": sslFn,
	"ahk3": k3Fn,
	"gxk3": k3Fn,
	"jsk3": k3Fn,
	"bjk3": k3Fn,
	"jlk3": k3Fn,
	"3fk3": k3Fn,
	"2fk3": k3Fn,
	"bj28": kl28Fn,
	"xy28": kl28Fn,
	"jnd28": kl28Fn,   
}

var QIU_SHU_CONTRL_OBJ = {
	"bjpk10": "bjpk10",
	"2fpk10": "bjpk10",
	"xyft": "bjpk10",
	"xysm": "bjpk10",
	"2fft": "bjpk10",
	"cqssc": "cqssc",
	"2fssc": "cqssc",
	"tjssc": "cqssc",
	"xjssc": "cqssc",
	"ah11x5": "gd11x5",
	"gd11x5": "gd11x5",
	"jx11x5": "gd11x5",
	"sd11x5": "gd11x5",
	"sh11x5": "gd11x5",
	"xg6hc": "xg6hc",
	"5f6hc":"xg6hc",
}
var SPECIAL_QIHAO_ARR = ["bjpk10", "2fpk10", "xysm" ,"2fft" ,"2fssc", "bjk3", "cqssc"]

function getSTRTime(date, letter) {
	var dateValue = date
	var y = dateValue.getFullYear()
	var m = dateValue.getMonth() + 1
	var d = dateValue.getDate()
	if (m < 10) {
		m = "0" + m
	}
	if (d < 10) {
		d = "0" + d
	}
	return y + letter + m + letter + d
}

function getNextNewQiHao(cname, qihao) {
	var qihaoValue = qihao
	var dateValue = qihaoValue.slice(0, 4) + "-" + qihaoValue.slice(4, 6) + "-" + qihaoValue.slice(6, 8)
	var newTimes = getSTRTime(new Date(new Date(dateValue).getTime() + 86400000), "")
	if (cname.indexOf("11x5") != -1||cname.indexOf("shssl") != -1) {
		return newTimes + "01"
	}
	return newTimes + "001" 
}

var IS_USER_MOVE = false

function setAllActItem(dataObj) {
	var allActDivs = $(".wfdiv")
	for (var i = 0; i < allActDivs.length; i++) {
		var item = allActDivs[i]
		var strValue = ""
		var strs = $(item).find(".act")
		for (var j = 0; j < strs.length; j++) {
			strValue += $(strs[j]).find("button").text() + ","
		}
		dataObj["str" + (i + 1)] = strValue
	}
}

var ZHUSHU = 0
var FAKE_ZHUSHU = 0

function bindStopQuickClickEvent(wapper,selector, callback) {
	if (isMobile()) {
		$(wapper).on("touchstart",selector,function(){
			IS_USER_MOVE = false
		})
		$(wapper).on("touchmove",selector,function(){
			IS_USER_MOVE = true
		}) 
	}
	$(wapper).on(getEndClickEvent(),selector,function(e) {
		if (IS_USER_MOVE && isMobile()) {
			return
		}			
		$("#checkboxhm").prop("checked", false)
		$(".zdsd.set").find("input").val("0")
		callback(e)
		var ajaxData = {
			url:  '/order/awards1.do',
			type: "post",
			data: {
				lotterid: $("#id").text(),
				cname: $("#cname").text(),
				cname1: $("#cname1").text(),
				period: Number($(".period").text())+1,
			},
			success: function(data) {
				var newData = JSON.parse(data)
				ZHUSHU = newData.data || ZHUSHU
				FAKE_ZHUSHU = newData.data
				if ($(".act").length == 0 || newData.data==0) {
					ZHUSHU = 0
				}
				$("#zhushu").text(ZHUSHU)
				gongji();
/*				var json=eval('('+data+')');
				if(json.data<1){
					$("#queding").attr("disabled","disabled");
				}*/
				MONEY_FROM_SERVER = newData.message
				COUNT_FROM_SERVER = newData.data
			},
			error: function(data) {
				$(e.currentTarget).removeClass("act")
				showNormalNoticeModal("#div-i-noticeGenDan", "提示：", "网络异常")
			}
		}		
		setAllActItem(ajaxData.data)
		ajax(ajaxData)		
	})
	
} 

function bindControlQiuItem() {
	var cname = $("#cname").text()
	if (QIU_SHU_CONTRL_OBJ[cname] != undefined) {
		ajax({
			url:  "/lotter/getQiu.do",
			type: "post",
			data: {"cname": QIU_SHU_CONTRL_OBJ[cname]},
			success: function(data) {
				var newData = JSON.parse(data)
				if (cname == "xg6hc" || cname == "5f6hc") {
					QIU_PICK_CONTROL[cname](newData.data)
				} else {
					QIU_PICK_CONTROL[cname](newData.data[0].kongzhisl)
				}
			},
			error: function(status) {
				showNormalNoticeModal("#div-i-noticeGenDan", "提示：", "网络异常")
			}
		})
	} else {
		if(cname=='bjl'){
			return;
		}
		if(cname != ""){
			QIU_PICK_CONTROL[cname]()
		}
	}
}



function pk10Fn(qiushu) {
	bindStopQuickClickEvent(".class-div-contentDiv",".xiazhu .col-xs-6", function(e) {
		var $self = $(e.currentTarget)
		$self.toggleClass("act")
		var $btnChild = $self.find("button")
		var btnValue = $btnChild.text()
		var isLeftValue = btnValue == "单" || btnValue == "大" || btnValue == "龙"
		var isRightValue = btnValue == "双" || btnValue == "小" || btnValue == "虎" 
		if ($self.hasClass("act") && isLeftValue) {
			$self.next().removeClass("act")
		}
		else if ($self.hasClass("act") && isRightValue) {
			$self.prev().removeClass("act")
		}
		else {
			var allBtn3Num = $self.parent().find(".col-xs-6.act .btn3").length
			if (allBtn3Num > qiushu) {
				layer.open({
				    type: 1,
				    area:['300px',"200px"],
				    title:"提示",
				    shadeClose: false, //点击遮罩关闭
				    anim: 4,
				    content: "当前玩法所选数字球不得大于" + qiushu + "个",    //右边也可以自己定义样式，引用时最外面的那个id,如$("#"+"ID名")
				    btn:'知道了',
				  });
				/*showNormalNoticeModal("#div-i-noticeGenDan", "提示：", "当前玩法所选数字球不得大于" + qiushu + "个")*/
				$self.removeClass("act")
			}
		}
	})
}

function sscFn(qiushu) {
	bindStopQuickClickEvent(".class-div-contentDiv",".xiazhu .col-xs-6", function(e) {
		var $self = $(e.currentTarget)
		$self.toggleClass("act")
		var $btnChild = $self.find("button")
		var btnValue = $btnChild.text()
		var isLeftValue = btnValue == "单" || btnValue == "大"
		var isRightValue = btnValue == "双" || btnValue == "小"
		var isLongHuValue = btnValue == "龙" || btnValue == "虎" || btnValue == "和" 
		if ($self.hasClass("act") && isLeftValue) {
			$self.next().removeClass("act")
		}
		else if ($self.hasClass("act") && isRightValue) {
			$self.prev().removeClass("act")
		}
		else if ($self.hasClass("act") && isLongHuValue) {
			if (btnValue == "龙") {
				$self.next().removeClass("act").next().removeClass("act")
			}
			else if (btnValue == "虎") {
				$self.next().removeClass("act")
				$self.prev().removeClass("act")
			}
			else {
				$self.prev().removeClass("act").prev().removeClass("act")
			}
		}
		if (!isLongHuValue) {
			var allBtn3Num = $self.parent().find(".col-xs-6.act .btn3").length
			if (allBtn3Num > qiushu) {
				layer.open({
				    type: 1,
				    area:['300px',"200px"],
				    title:"提示",
				    shadeClose: false, //点击遮罩关闭
				    anim: 4,
				    content: "当前玩法所选数字球不得大于" + qiushu + "个",    //右边也可以自己定义样式，引用时最外面的那个id,如$("#"+"ID名")
				    btn:'知道了',
				  });
				/*showNormalNoticeModal("#div-i-noticeGenDan", "提示：", "当前玩法所选数字球不得大于" + qiushu + "个")*/
				$self.removeClass("act")
			}
		}
	})
	bindStopQuickClickEvent(".class-div-contentDiv",".xiazhu .myfl", function(e) {
		var $self = $(e.currentTarget)
		$self.toggleClass("act")
		
	})
}

function kl10fFn() {
	bindStopQuickClickEvent(".class-div-contentDiv",".xiazhu .myfl,.col-xs-6", function(e) {
		var $self = $(e.currentTarget)
		$self.toggleClass("act")		
	})
}

function cz11x5Fn(qiushu) {
	bindStopQuickClickEvent(".class-div-contentDiv",".xiazhu .col-xs-6", function(e) {
		var $self = $(e.currentTarget)
		$self.toggleClass("act")
		var $btnChild = $self.find("button")
		var btnValue = $btnChild.text()
		var isLeftValue = btnValue == "单" || btnValue == "大"
		var isRightValue = btnValue == "双" || btnValue == "小"
		if ($self.hasClass("act") && isLeftValue) {
			$self.next().removeClass("act")
		}
		else if ($self.hasClass("act") && isRightValue) {
			$self.prev().removeClass("act")
		}
		else {
			var allBtn3Num = $self.parent().find(".col-xs-6.act .btn3").length
			if (allBtn3Num > qiushu) {
				layer.open({
				    type: 1,
				    area:['300px',"200px"],
				    title:"提示",
				    shadeClose: false, //点击遮罩关闭
				    anim: 4,
				    content: "当前玩法所选数字球不得大于" + qiushu + "个",    //右边也可以自己定义样式，引用时最外面的那个id,如$("#"+"ID名")
				    btn:'知道了',
				  });
				/*showNormalNoticeModal("#div-i-noticeGenDan", "提示：", "当前玩法所选数字球不得大于" + qiushu + "个")*/
				$self.removeClass("act")
			}
		}
	})	
	bindStopQuickClickEvent(".class-div-contentDiv",".xiazhu .myfl", function(e) {
		var $self = $(e.currentTarget)
		$self.toggleClass("act")		
	})		
}

function kl28Fn(qiushu) {
	bindStopQuickClickEvent(".class-div-contentDiv",".xiazhu .col-xs-6", function(e) {
		var $self = $(e.currentTarget)
		$self.toggleClass("act")
		var $btnChild = $self.find("button")
		var btnValue = $btnChild.text()
		var isLeftValue = btnValue == "单" || btnValue == "大" || btnValue == "大单" || btnValue == "小单" || btnValue == "极大" 
		var isRightValue = btnValue == "双" || btnValue == "小"|| btnValue == "大双" || btnValue == "小双" || btnValue == "极小"
		if ($self.hasClass("act") && isLeftValue) {
			$self.next().removeClass("act")
		}
		else if ($self.hasClass("act") && isRightValue) {
			$self.prev().removeClass("act")
		}
	})
	var arrTmb3=[]
	bindStopQuickClickEvent(".class-div-contentDiv",".xiazhu .myfl", function(e) {
		var $self = $(e.currentTarget)
		$self.toggleClass("act")
		var title=$self.parent().find('.title').text()
		if(title=='特码包三'){
			if($self.hasClass('act')){
				arrTmb3.push($self.find('button').text())
			}else{
				var index=arrTmb3.indexOf($self.find('button').text())
				arrTmb3.splice(index,1)
				console.log(arrTmb3)
			}
			var actLen=$self.parent().find('.act')
			if(arrTmb3.length==4){
				for(i=0;i<actLen.length;i++){
					if(actLen.eq(i).find('button').text()==arrTmb3[0]){
						actLen.eq(i).removeClass('act')
						arrTmb3.shift()
						return;
					}
				}
			}
		}
	})
}


function xg6hcFn(qiushu) {
	console.log(qiushu.length)
	var xgArr = {}
	for (var i = 0; i < qiushu.length; i++) {
		var item = qiushu[i]
		xgArr[item.cplay] = item.kongzhisl
	}
	for (var z = 5; z < 9; z++) {
		var fivebuzhong = z + "不中"
		xgArr[fivebuzhong] = xgArr["5-8不中"]
	}
	for (var v = 9; v < 11; v++) {
		var ninebuzhong = v + "不中"
		xgArr[ninebuzhong] = xgArr["9-10不中"]
	}
	bindStopQuickClickEvent(".class-div-contentDiv",".xiazhu .myfl", function(e) {
		var $self = $(e.currentTarget)
		$self.toggleClass("act")
		var $parent = $self.parent()
		if ($parent.find(".title").text().length >= 17 && $self.hasClass("act")) {
			var titleValue = $parent.find(".title").text().split(" ")[2].split("　")[0]
			var allBtn3Num = $parent.find(".myfl.act .btn3").length
			var qiuNum = Number(xgArr[titleValue])
			if (qiuNum != undefined && allBtn3Num > qiuNum) {
				layer.open({
				    type: 1,
				    area:['300px',"200px"],
				    title:"提示",
				    shadeClose: false, //点击遮罩关闭
				    anim: 4,
				    content: "当前玩法所选数字球不得大于" + qiushu + "个",    //右边也可以自己定义样式，引用时最外面的那个id,如$("#"+"ID名")
				    btn:'知道了',
				  });
				/*showNormalNoticeModal("#div-i-noticeGenDan", "提示：", "当前玩法所选数字球不得大于" + qiuNum + "个")*/
				$self.removeClass("act")
			}				
		}
		else if(($parent.find(".title").text() === "特码A" || $parent.find(".title").text() === "特码B") && $self.hasClass("act")) {
			var qiuNum = Number(xgArr["特码"])
			var allBtn3Num = $parent.find(".myfl.act .btn3").length
			if (qiuNum != undefined && allBtn3Num > qiuNum) {
				layer.open({
				    type: 1,
				    area:['300px',"200px"],
				    title:"提示",
				    shadeClose: false, //点击遮罩关闭
				    anim: 4,
				    content: "当前玩法所选数字球不得大于" + qiushu + "个",    //右边也可以自己定义样式，引用时最外面的那个id,如$("#"+"ID名")
				    btn:'知道了',
				  });
				/*showNormalNoticeModal("#div-i-noticeGenDan", "提示：", "当前玩法所选数字球不得大于" + qiuNum + "个")*/
				$self.removeClass("act")
			}				
		}
	})	
	bindStopQuickClickEvent(".class-div-contentDiv",".xiazhu .col-xs-6", function(e) {
		var $self = $(e.currentTarget)
		$self.toggleClass("act")
		var $btnChild = $self.find("button")
		var btnValue = $btnChild.text()
		var isDoubleLeftValue = btnValue.indexOf("大单") != -1 ||  btnValue.indexOf("小单") != -1
		var isDoubleRightValue = btnValue.indexOf("大双") != -1  ||  btnValue.indexOf("小双") != -1
		var isLeftValue = btnValue.indexOf("单") != -1  || btnValue.indexOf("大") != -1 || btnValue.indexOf("家肖") != -1 || btnValue.indexOf("天肖") != -1 
		var isRightValue = btnValue.indexOf("双") != -1 || btnValue.indexOf("小") != -1 || btnValue.indexOf("野肖") != -1 ||  btnValue.indexOf("地肖") != -1 
		if ($self.hasClass("act")) {
			if (isDoubleLeftValue) {
				$self.next().removeClass("act")
			}
			else if (isDoubleRightValue) {
				$self.prev().removeClass("act")
			}
			else if (isLeftValue) {
				$self.next().removeClass("act")
			}
			else if (isRightValue) {
				$self.prev().removeClass("act")
			}
		}
	})
}	

function sslFn() {
	bindStopQuickClickEvent(".class-div-contentDiv",".xiazhu .myfl", function(e) {
		var $self = $(e.currentTarget)
		$self.toggleClass("act")	
	})
}

function k3Fn() {
	bindStopQuickClickEvent(".class-div-contentDiv",".xiazhu .myfl", function(e) {
		var $self = $(e.currentTarget)
		$self.toggleClass("act")
		if ($self.hasClass("act")) {
			var $btnChild = $self.find("button")
			var btnValue = $btnChild.text()
			var isLeftValue = btnValue == "大" || btnValue == "单"
			var isRightValue = btnValue == "小" || btnValue == "双"
			if (isLeftValue) {
				$self.next().removeClass("act")
			}
			else if (isRightValue) {
				$self.prev().removeClass("act")
			}
			// 二同号单选
			var $parent = $self.parent()
			if ($parent.find(".title").length > 0) {
				var titleVaue1 = $parent.find(".title").text()
				if (titleVaue1.indexOf("二同号单选") != -1 || titleVaue1.indexOf("二不同号胆拖") != -1) {
					var index = $self.index() - 1
					$parent.next().find(".myfl").eq(index).removeClass("act")					
				}
			}
			else if ($parent.prev().find(".title").length > 0) {
				var titleVaue2 = $parent.prev().find(".title").text()
				if (titleVaue2.indexOf("二同号单选") != -1 || titleVaue2.indexOf("二不同号胆拖") != -1) {
					var index = $self.index()
					$parent.prev().find(".myfl").eq(index).removeClass("act")					
				}				
			}
		}		
	})	
}

function xianggangLiuHeCaiLotter(node) {
	var $targetSelector = $(node)
	if ($targetSelector.text() === "官方开奖异常" || $targetSelector.text() === "平台开奖异常" ) {
		return
	}
	if ($targetSelector.text().trim() === "") {
		$targetSelector.html("<span style='margin:1px;color:white;width:0.40rem;height:0.40rem;line-height:0.40rem;font-size:0.21rem;display:inline-block;' class='text-center yuan qiu8'>正</span><span style='margin:1px;color:white;width:0.40rem;height:0.40rem;line-height:0.40rem;font-size:0.21rem;display:inline-block;' class='text-center yuan qiu8'>在</span><span style='margin:1px;color:white;width:0.40rem;height:0.40rem;line-height:0.40rem;font-size:0.21rem;display:inline-block;' class='text-center yuan qiu8'>开</span><span style='margin:1px;color:white;width:0.40rem;height:0.40rem;line-height:0.40rem;font-size:0.21rem;display:inline-block;' class='text-center yuan qiu8'>奖</span>")
		return
	}	
	var lotternumber=$targetSelector.text().split(",");
	var lotter="";
	for(var i=0;i<lotternumber.length-1;i++){
		var x = Number(lotternumber[i]);
		lotter+="<div style='margin:1px;color:white;width:0.40rem;height:0.40rem;line-height:0.40rem;font-size:0.21rem;display:inline-block;'";
		if($("#cname").text().indexOf("pk10")!=-1 ||$("#cname").text().indexOf("xyft")!=-1 || $("#cname").text().indexOf("xysm")!=-1){
			lotter+="class='text-center yuan qiu"+x+"'>"+lotternumber[i]+"</div>";
		}
		else{
			lotter+="class='text-center yuan qiu8'>"+lotternumber[i]+"</div>";
		}
	}
	var lotternumber1=$targetSelector.text().split(",");
	$targetSelector.html(lotter);
	if ($("#cname").text() == "xg6hc" || $("#cname").text() == "5f6hc") {
		$targetSelector.find(".yuan").each(function(index, element) {
			var $element = $(element)
			var val = $element.text()
			if (blueArr.indexOf(val) != -1) {
				$element.removeClass("qiu8").css("background", "#336DCC")
			}
			else if (greenArr.indexOf(val) != -1) {
				$element.removeClass("qiu8").css("background", "#09B832")
			}
		})
		var $allYuanNodes = $targetSelector.find(".yuan")
		$allYuanNodes.eq($allYuanNodes.length - 1).before("<div class='fakejiahao' style='margin: 1px;color: white;width: 0.45rem;height: 0.45rem;justify-content:center;align-items:center;font-size: 0.53rem;display: inline-flex;color:black;'>+</div>")
	}
}

function qiu(){	
	if ($(".lotternumber").text() === "官方开奖异常" || $(".lotternumber").text() === "平台开奖异常") {
		$(".lotternumber").html($(".lotternumber").text())
		return
	}
	if ($(".lotternumber").text().trim() === "") {
		$(".lotternumber").html("<span style='margin:1px;color:white;width:0.40rem;height:0.40rem;line-height:0.40rem;font-size:0.21rem;display:inline-block;' class='text-center yuan qiu8'>正</span><span style='margin:1px;color:white;width:0.40rem;height:0.40rem;line-height:0.40rem;font-size:0.21rem;display:inline-block;' class='text-center yuan qiu8'>在</span><span style='margin:1px;color:white;width:0.40rem;height:0.40rem;line-height:0.40rem;font-size:0.21rem;display:inline-block;' class='text-center yuan qiu8'>开</span><span style='margin:1px;color:white;width:0.40rem;height:0.40rem;line-height:0.40rem;font-size:0.21rem;display:inline-block;' class='text-center yuan qiu8'>奖</span>")
		return
	}
	var lotternumber=$(".lotternumber").text().split(",");
	var lotter="";
	for(var i=0;i<lotternumber.length-1;i++){	
		var x = Number(lotternumber[i]);
		lotter+="<div style='margin:1px;color:white;width:0.40rem;height:0.40rem;line-height:0.40rem;font-size:0.21rem;display:inline-block;'";
		if($("#cname").text().indexOf("pk10")!=-1 || $("#cname").text().indexOf("xysm")!=-1 || $("#cname").text().indexOf("xyft")!=-1 ){
			lotter+="class='text-center yuan qiu"+x+"'>"+lotternumber[i]+"</div>";
		}
		else if($("#cname").text().indexOf("k3")!=-1){
			lotter+="class='shaizi sz"+x+"'></div>"
		}/*else if($("#cname").text().indexOf("kl10f")!=-1){
			if(x<10){
				x="0"+x
			}
			lotter+="class='klsf sg"+x+"'></div>"
		}*/else if($("#cname").text().indexOf("28")!=-1){
			var total=Number(lotternumber[0])+ Number(lotternumber[1])+ Number(lotternumber[2])
			if(i<lotternumber.length-2){
				lotter+="class='text-center yuan qiu8'>"+x+"</div><div style='display:inline-block;color:red;'>+</div>"
			}else{
				lotter+="class='text-center yuan qiu8'>"+x+"</div><div style='display:inline-block;color:red;'>=</div><div style='margin:1px;color:white;width:0.40rem;height:0.40rem;line-height:0.40rem;font-size:0.21rem;display:inline-block;' class='text-center yuan qiu8'>"+total+"</div>"
			}
		}
		else{
			lotter+="class='text-center yuan qiu8'>"+lotternumber[i]+"</div>";
		}
	}
	var lotternumber1=$(".lotternumber1").text().split(",");
	$(".lotternumber").html(lotter);
	if ($("#cname").text() == "xg6hc" || $("#cname").text() == "5f6hc") {
		$(".lotternumber .yuan").each(function(index, element) {
			var $element = $(element)
			var val = $element.text()
			if (blueArr.indexOf(val) != -1) {
				$element.removeClass("qiu8").css("background", "#336DCC")
			}
			else if (greenArr.indexOf(val) != -1) {
				$element.removeClass("qiu8").css("background", "#09B832")
			}
		})
		var $allYuanNodes = $(".lotternumber .yuan")
		$allYuanNodes.eq($allYuanNodes.length - 1).before("<div style='margin: 1px;color: white;width: 0.45rem;height: 0.45rem;justify-content:center;align-items:center;font-size: 0.53rem;display: inline-flex;color:black;'>+</div>")
	}
}

//检查是合买还是跟单
function checkHeMaiAndGenDanStatus() {
	var newRequest = {
		url:  "/cplayFlag.do",
		type: "post",
		data: {},
		success: function(data) {
			var newData = JSON.parse(data)
			if (newData.data.gendan === 1) {
				$(".span-c-gendanWrapper").addClass("active")
			}
			if (newData.data.hemai === 1) {
				$(".span-c-hemaiWrapper").addClass("active")
			}					
		},
		error: function(status) {
		}
	}
	ajax(newRequest)		
}

				//展示用户下注信息
				function setSlideData(data) {
					var html=""
					for (var i = 0; i < data.length; i++) {
						var item = data[i];
						var zhushu;
						var game=item.cname1;
						var lotterMoney = item.acount;
						var userName = item.huiyuanzh.slice(0, item.huiyuanzh.length - 1) + "*"
						html = "<span class='item' style='display:inline-block;'>用户<span class='nickname'>" + userName + "</span>在" + game + "玩法 下注 <span class='important'>￥" + lotterMoney + "</span></span>"
						$("#test1").find("nobr").append(html)	
					}	
					var allWidths = 0
					if($("#test1 span").length!=0){
						var allSpans = document.querySelector("#test1").querySelectorAll("span")
						for (var z = 0; z < allSpans.length; z++) {
							var spanItem = allSpans[z]
							allWidths += spanItem.clientWidth
						}
					}
					var i =0
					i = $("#test1").width()
					var transform = 0
					$("#test1").css({
						"margin-left": i + "px",
					})
					var player
					clearInterval(player)
					player=window.setInterval(function() {
						if($("#test1").length==0){
							clearInterval(player)
							return;
						}else{
							$("#test1").css("transform", "translateX(-" + transform + "px)")
							transform++
							if (Math.abs(transform) == (allWidths + i)) {
								transform = 0
							}
						}
					}, 20)
				}

function timeFn1(xitongTime, caizhongStart, caizhongEnd) {
	var m1 = xitongTime.split(" ")[1] //系统时间  23:57:00
	var start1 = caizhongStart       // 开始时间
	var end1 = caizhongEnd   // 23:57:00 // 结束时间
	var m1Hour = Number(m1.split(":")[0]) // 19  // 系统小时
	var start1Hour = Number(start1.split(":")[0]) // 开始小时 
	var m1Min = Number(m1.split(":")[1]) // 2      系统分钟
	var start1Min = Number(start1.split(":")[1]) // 26 开始分钟
	var m1S = Number(m1.split(":")[2]) // 00  // 系统秒数
	var startS = Number(start1.split(":")[2]) // 26 开始秒数
	if (m1Hour < start1Hour) {
		return false
	}
	else if (m1Hour == start1Hour) {
		if (m1Min < start1Min) {
			return false
		}
		else if (m1Min == start1Min) {
			if (m1S < startS) {
				return false
			}
		}
	}
	var e1Hour = Number(caizhongEnd.split(":")[0])
	var e1Min = Number(caizhongEnd.split(":")[1])
	var e1S = Number(caizhongEnd.split(":")[2]) 
	if (m1Hour > e1Hour) {
		return false
	}
	else if (m1Hour == e1Hour) {
		if (m1Min > e1Min) {
			return false
		}
		else if (m1Min == e1Min) {
			if (m1S > e1S) {
				return false
			}
		}
	}
	return true	
}

var arr1 = ["bjpk10", "cqssc", "tjssc", "gdkl10f", "ah11x5", "gd11x5", "jx11x5", "sd11x5", "sh11x5", "shssl", "ahk3", "gxk3", "jsk3", "bjk3", "jlk3"]
var arr2 = {
            "xyft": ["13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "00", "01", "02", "03", "04"],
            "xjssc": ["10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "00", "01", "02"],
            "cqkl10f": ["10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "00", "01", "02"],
            "cqssc": ["10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "00", "01"]
}

function timeFn2(xitongTime, caizhongStart, caizhongEnd, cname) {
	var targetArr = arr2[cname]
	if (targetArr == undefined) {
		return true
	}
	var m1 = xitongTime.split(" ")[1] //系统时间  23:57:00
	var start1 = caizhongStart       // 开始时间
	var end1 = caizhongEnd   // 23:57:00 // 结束时间
	var unTransHour = m1.split(":")[0]
	var m1Hour = Number(m1.split(":")[0]) // 19  // 系统小时
	var start1Hour = Number(start1.split(":")[0]) // 开始小时 
	var m1Min = Number(m1.split(":")[1]) // 2      系统分钟
	var start1Min = Number(start1.split(":")[1]) // 26 开始分钟
	var m1S = Number(m1.split(":")[2]) // 00  // 系统秒数
	var startS = Number(start1.split(":")[2]) // 26 开始秒数
	if (!(targetArr.indexOf(unTransHour) != -1)) {
		return false
	}
	if (m1Hour == start1Hour) {
		if (m1Min < start1Min) {
			return false
		}
		else if (m1Min == start1Min) {
			if (m1S < startS) {
				return false
			}
		}		
	}
	var e1Hour = Number(caizhongEnd.split(":")[0])
	var e1Min = Number(caizhongEnd.split(":")[1])
	var e1S = Number(caizhongEnd.split(":")[2]) 
	if (m1Hour == e1Hour) {
		if (m1Min > e1Min) {
			return false
		}
		else if (m1Min == e1Min) {
			if (m1S > e1S) {
				return false
			}
		}
	}
	return true
}

function isTimeRight(xitongTime, caizhongStart, caizhongEnd, cname) {
	if (arr1.indexOf(cname) != -1) {
		return timeFn1(xitongTime, caizhongStart, caizhongEnd)
	}
	else {
		return timeFn2(xitongTime, caizhongStart, caizhongEnd, cname)
	}
}

function checkIsLastMark(currentT, endT, timeS) {
	var cArray = currentT.split(" ")[1].split(":")
	var eArray = endT.split(":")
	var cHour = cArray[0]
	var eHour = eArray[0]
	if (cHour != eHour) {
		return false
	}
	var nCmin = Number(cArray[1]) * 60
	var nEmin = Number(eArray[1]) * 60
	if (Math.abs(nEmin - nCmin) <= timeS) {
		return true
	}
	return false
}

function isFirstTime(nextTime, lastTime, timespace, isChanged, xitongShiJian, startTime, endTime, cname) {
//() && ISFIRSTLOTTER_flag && isTimeRight(json.message, json.data.startTime, json.data.endTime, $("#cname").text())
	var nextT = new Date(nextTime).getTime()
	var lastT = new Date(lastTime).getTime()
	var isJianGeBig = Math.floor(nextT / 1000) - Math.floor(lastT / 1000) > timespace + 300
	var isChanged = isChanged
	var isCurrentTime = isTimeRight(xitongShiJian, startTime, endTime, cname)
	var isFirst = nextTime.split(" ")[1] == startTime
	return isJianGeBig && isChanged && isCurrentTime && isFirst
}


// 北京 pk 拾，
